package com.yndsoft.jc.supplier.base;

import android.content.Context;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;

import com.yndsoft.jc.supplier.net.HttpUtil;
import com.yndsoft.jc.supplier.utils.AppSession;
import com.yndsoft.jc.supplier.utils.UiUtils;

public abstract class SupplierBaseFragmentActivity extends AppCompatActivity {

    protected Context mContext;
    protected AppSession mSession;
    protected HttpUtil mHttpUtil;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(getContentResId());
        mContext = this;
        UiUtils.initSoftInputHide(this);
        mSession = AppSession.getInstance(mContext.getApplicationContext());
        mHttpUtil = HttpUtil.getInstance();
        initView();
        initData();
    }

    public abstract int getContentResId();
    public abstract void initView();
    public abstract void initData();

    @Override
    protected void onDestroy() {
        super.onDestroy();
        mContext = null;
        mSession = null;
    }
}
